<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
    wx.config({
      debug: false,
      appId: '<?php echo $this->params['jsconfig']['appId']?>',
      timestamp: <?php echo $this->params['jsconfig']['timestamp']?>,
      nonceStr: '<?php echo $this->params['jsconfig']['noncestr']?>',
      signature: '<?php echo $this->params['jsconfig']['signature']?>'
    });
</script>
<div class="order-confirm">
     <img class="d-hangtag" src="/shared/img/d-hangtag.png" />
     <section class="main">
         <h2>检测摘要</h2>
         <div class="order-info">
              <h3><?php echo $this->params['tester']?></h3> <?php echo $this->params['num']?>份<span class="special">【<?php echo $this->params['product']['product_name']?>】</span>采样器正在寄往：
              <p class="express-info">
                    <span><?php echo $this->params['address']['address_area'] . $this->params['address']['address']?></span>
                    <span><?php echo $this->params['address']['receiver_name']?>&nbsp;<?php echo $this->params['address']['receiver_phone']?></span>
               </p>
               <div class="flex-wrapper flex-pack-justify">
                    <p>现在还差最后一步</p>
                    <p>需付：<span class="special">¥<?php echo $this->params['total']?></span></p>
              </div>
         </div>
      </section>
      <a class="btn btn-footer" id="pay" href="javascript:void(0)">微信支付</a>
</div>
<script>
	Zepto(function($){
	    $('#pay').click(function(){
	        //一旦提交操作执行，按钮要禁用
	        var btn = $(this);
	        btn[0].disabled = true;
	        btn.html('订单处理中，请耐心等待...');
	
	        var orderId = '<?php echo $this->params['order']['order_id']?>';
	        wx.chooseWXPay({
	            timestamp: <?php echo $this->params['payparam']['timeStamp']?>,
	            nonceStr: '<?php echo $this->params['payparam']['nonceStr']?>',
	            package: '<?php echo $this->params['payparam']['package']?>',
	            signType: '<?php echo $this->params['payparam']['signType']?>',
	            paySign: '<?php echo $this->params['payparam']['paySign']?>',
	            success: function (payres) {
	            	window.location.href = '/pay/success?orderid='+orderId;
	                //预约成功，设置支付成功
// 	                $.post('/pay/paycallback', {'orderid':orderId},function(json) {
	                    
// 	                });
	            }
	        });
	    });
	});
</script>